import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/yxUser',
    method: 'post',
    data
  })
}

export function del(uid) {
  return request({
    url: 'api/yxUser/' + uid,
    method: 'delete'
  })
}

export function edit(data) {
  return request({
    url: 'api/yxUser',
    method: 'put',
    data
  })
}

export function onStatus(id, data) {
  return request({
    url: 'api/yxUser/onStatus/' + id,
    method: 'post',
    data
  })
}

export function editp(data) {
  return request({
    url: 'api/yxUser/money',
    method: 'post',
    data
  })
}


export function getSpread(data) {
  return request({
    url: 'api/yxUser/spread',
    method: 'post',
    data
  })
}

// 额外添加
export function getStoreProduct() {
  return request({
    url: `api/yxStoreProduct?page=0&size=999&sort=id,desc&isShow=1&isDel=0&cateId=&merId=0`,
    method: 'get'
  })
}

// 系统用户关联平台直营商品
export function userProductApi(data) {
  return request({
    url: `api/userProduct`,
    method: 'post',
    data
  })
}

export function getUserProduct(data) {
  return request({
    url: `api/userProduct?userId=${data.userId}`,
    method: 'get'
  })
}
